<?php
$config = array(
		'user/create' => array(
			array(
					'field' => 'username',
					'label' => 'lang:tpl_username',
					'rules' => 'trim|required|min_length[3]|max_length[30]|alpha_dash|callback_check[username]'
			),
			array(
					'field' => 'password',
					'label' => 'lang:tpl_password',
					'rules' => 'trim|required|min_length[6]|max_length[20]'
			),
			array(
					'field' => 'password_repeat',
					'label' => 'lang:tpl_passwordconfirm',
					'rules' => 'required|matches[password]'
			),
			array(
					'field' => 'email',
					'label' => 'lang:tpl_email',
					'rules' => 'trim|required|valid_email|callback_check[email]'
			)
		),
	'users/create' => array(
		array(
			'field' => 'username',
			'label' => 'lang:tpl_username',
			'rules' => 'trim|required|min_length[3]|max_length[30]|alpha_dash|callback_check[username]'
		),
		array(
			'field' => 'password',
			'label' => 'lang:tpl_password',
			'rules' => 'trim|required|min_length[6]|max_length[20]'
		),
		array(
			'field' => 'password_cf',
			'label' => 'lang:tpl_passwordconfirm',
			'rules' => 'required|matches[password]'
		),
		array(
			'field' => 'email',
			'label' => 'lang:tpl_email',
			'rules' => 'trim|required|valid_email|callback_check[email]'
		)
	),
	'users/edit' => array(
		array(
			'field' => 'username',
			'label' => 'lang:tpl_username',
			'rules' => 'trim|required|min_length[3]|max_length[30]|alpha_dash|callback_check[username]'
		),
	),
	'modules/create' => array(
		array(
			'field' => 'mod_name',
			'label' => 'lang:tpl_modulename',
			'rules' => 'trim|required|min_length[2]|max_length[30]|is_unique[sys_modules.mod_name]'
		),
		array(
			'field' => 'mod_code',
			'label' => 'lang:tpl_modulecode',
			'rules' => 'trim|required|min_length[3]|max_length[30]|alpha_dash|is_unique[sys_modules.mod_code]'
		),/*
		array(
			'field' => 'mod_url',
			'label' => 'lang:tpl_moduleurl',
			'rules' => 'trim|required|min_length[3]|max_length[30]'
		),*/
		array(
			'field' => 'sorts',
			'label' => 'lang:tpl_sorts',
			'rules' => 'trim|required|is_natural'
		)
	),
	'modules/edit' => array(
		array(
			'field' => 'mod_name',
			'label' => 'lang:tpl_modulename',
			'rules' => 'trim|required|min_length[2]|max_length[30]'
		),
		array(
			'field' => 'mod_code',
			'label' => 'lang:tpl_modulecode',
			'rules' => 'trim|required|min_length[3]|max_length[30]|alpha_dash'
		),
		/*array(
			'field' => 'mod_url',
			'label' => 'lang:tpl_moduleurl',
			'rules' => 'trim|required|min_length[3]|max_length[30]'
		),*/
		array(
			'field' => 'sorts',
			'label' => 'lang:tpl_sorts',
			'rules' => 'trim|required|is_natural'
		)
	),
	'metagroups/create' => array(
		array(
			'field' => 'name',
			'label' => 'lang:tpl_metagroupname',
			'rules' => 'trim|required|min_length[3]|max_length[30]'
		),
		array(
			'field' => 'code',
			'label' => 'lang:tpl_metagroupcode',
			'rules' => 'trim|required|min_length[3]|max_length[30]|alpha_dash'
		)
	),
	'metagroups/edit' => array(
		array(
			'field' => 'name',
			'label' => 'lang:tpl_metagroupname',
			'rules' => 'trim|required|min_length[3]|max_length[30]'
		),
		array(
			'field' => 'code',
			'label' => 'lang:tpl_metagroupcode',
			'rules' => 'trim|required|min_length[3]|max_length[30]|alpha_dash'
		)
	),
	'posts/create' => array(
		array(
			'field' => 'articles[title]',
			'label' => 'lang:tpl_title',
			'rules' => 'trim|required'
		),
		array(
				'field' => 'articles[summary]',
				'label' => 'lang:tpl_summary',
				'rules' => 'trim|required|max_length[600]'
		),
		array(
			'field' => 'articles[content]',
			'label' => 'lang:tpl_content',
			'rules' => 'trim|required'
		),
	),
	'posts/edit' => array(
		array(
				'field' => 'articles[title]',
				'label' => 'lang:tpl_title',
				'rules' => 'trim|required'
		),
		array(
				'field' => 'articles[summary]',
				'label' => 'lang:tpl_summary',
				'rules' => 'trim|required|max_length[600]'
		),
		array(
				'field' => 'articles[content]',
				'label' => 'lang:tpl_content',
				'rules' => 'trim|required'
		),
	),
	'categories/create' => array(
		array(
			'field' => 'category[name]',
			'label' => 'lang:tpl_categoryname',
			'rules' => 'trim|required'
		),
	),
	'categories/edit' => array(
		array(
				'field' => 'category[name]',
				'label' => 'lang:tpl_categoryname',
				'rules' => 'trim|required'
		),
	),
	'ads/create' => array(
		array(
				'field' => 'ad_name',
				'label' => 'lang:tpl_name',
				'rules' => 'trim|required'
		),
	),
	'ads/edit' => array(
		array(
				'field' => 'ad_name',
				'label' => 'lang:tpl_name',
				'rules' => 'trim|required'
		),
	),
	'comments/create' => array(
		array(
				'field' => 'content',
				'label' => 'lang:tpl_content',
				'rules' => 'trim|required|max_length[100]'
		),
	),
);
